package com.ruoyi.system.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteQYLoginService;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;

/**
 * 企业微信登录服务降级处理
 *
 * @author ruoyi
 */
@Component
public class RemoteQYLoginFallbackFactory implements FallbackFactory<RemoteQYLoginService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteQYLoginFallbackFactory.class);

    @Override
    public RemoteQYLoginService create(Throwable throwable)
    {
        log.error("企业微信登录服务调用失败:{}", throwable.getMessage());
        return new RemoteQYLoginService()
        {

            @Override
            public String get_login_qrcode(HashMap<String, List<HashMap<String, Object>>> map) {
                return null;
            }

            @Override
            public String check_login_qrcode(HashMap<String, List<HashMap<String, Object>>> map) {
                return null;
            }

            @Override
            public String push_login_url(HashMap<String, List<HashMap<String, Object>>> map) {
                return null;
            }

            @Override
            public String verify_login_qrcode(HashMap<String, List<HashMap<String, Object>>> map) {
                return null;
            }

            @Override
            public String auto_login(HashMap<String, List<HashMap<String, Object>>> map) {
                return null;
            }
        };
    }
}
